package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-01-29
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_base_bank")
@ApiModel(value = "BaseBank", description = "")
@AllArgsConstructor
public class BaseBank extends Entity<String> {

    private static final long serialVersionUID = 1L;

    /**
     * 简称
     */
    @ApiModelProperty(value = "简称")
    @NotEmpty(message = "简称不能为空")
    @Length(max = 64, message = "简称长度不能超过64")
    @TableField(value = "abbr", condition = LIKE)
    @Excel(name = "简称")
    private String abbr;

    /**
     * 银行名称
     */
    @ApiModelProperty(value = "银行名称")
    @NotEmpty(message = "银行名称不能为空")
    @Length(max = 32, message = "银行名称长度不能超过32")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "银行名称")
    private String bankName;

    /**
     * 银行代码
     */
    @ApiModelProperty(value = "银行代码")
    @NotEmpty(message = "银行代码不能为空")
    @Length(max = 32, message = "银行代码长度不能超过32")
    @TableField(value = "bank_code", condition = LIKE)
    @Excel(name = "银行代码")
    private String bankCode;

    /**
     * 联行号
     */
    @ApiModelProperty(value = "联行号")
    @NotEmpty(message = "联行号不能为空")
    @Length(max = 32, message = "联行号长度不能超过32")
    @TableField(value = "bank_cnaps", condition = LIKE)
    @Excel(name = "联行号")
    private String bankCnaps;

    /**
     * apiCode
     */
    @ApiModelProperty(value = "apiCode")
    @Length(max = 32, message = "apiCode长度不能超过32")
    @TableField(value = "api_code", condition = LIKE)
    @Excel(name = "apiCode")
    private String apiCode;


    @Builder
    public BaseBank(String id, String createUser, LocalDateTime createTime, String updateUser, LocalDateTime updateTime, 
                    String abbr, String bankName, String bankCode, String bankCnaps, String apiCode) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.abbr = abbr;
        this.bankName = bankName;
        this.bankCode = bankCode;
        this.bankCnaps = bankCnaps;
        this.apiCode = apiCode;
    }

}
